#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmockery.h>

int add (const int a, const int b)
{
	check_expected(a);
	check_expected(b);
	return a + b;
}

int customer_add()
{
	return add(1, 3);
}

void test_customer_add(void** state)
{
	expect_value(add, a, 1);
	expect_value(add, b, 3);
	assert_int_equal(customer_add(), 4);
}

void test_customer_add_bad_a(void** state)
{
	expect_value(add, a, 2);
	expect_value(add, b, 3);
	assert_int_equal(customer_add(), 4);
}

void test_customer_add_missing_b(void** state)
{
	expect_value(add, a, 1);
	assert_int_equal(customer_add(), 4);
}

int main (void)
{
	const UnitTest tests[] = {
		unit_test(test_customer_add),
		unit_test(test_customer_add_bad_a),
		unit_test(test_customer_add_missing_b),
	};

	return run_tests(tests);
}
